﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NationalD3.Application.ViewModels
{
    /// <summary>
    /// Student的视图模型
    /// </summary>
    public class StudentViewModel
    {
        public Guid Id { get; set; }

        [Required(ErrorMessage = "The Name is Required")]
        [MinLength(2)]
        [MaxLength(100)]
        [DisplayName("姓名")]
        public string Name { get; set; }

        [Required(ErrorMessage = "The E-mail is Required")]
        [EmailAddress]
        [DisplayName("E-mail")]
        public string Email { get; set; }

        [Required(ErrorMessage = "The BirthDate is Required")]
        [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:yyyy-MM-dd}")]
        [DataType(DataType.Date, ErrorMessage = "Data em formato inválido")]
        [DisplayName("出生日期")]
        public DateTime BirthDate { get; set; }

        /// <summary>
        /// 手机
        /// </summary>
        [Required(ErrorMessage = "The Phone is Required")]
        [StringLength(11)]
        [DisplayName("手机")]
        public string Phone { get; set; }

        //以下几个是值对象里面的字段
        /// <summary>
        /// 省份
        /// </summary>
        [Required(ErrorMessage = "The Province is Required")]
        [DisplayName("省份")]
        public string Province { get; set; }

        /// <summary>
        /// 城市
        /// </summary>
        [Required(ErrorMessage = "The City is Required")]
        [DisplayName("城市")]
        public string City { get; set; }

        /// <summary>
        /// 区县
        /// </summary>
        [Required(ErrorMessage = "The County is Required")]
        [DisplayName("区县")]
        public string County { get; set; }

        /// <summary>
        /// 街道
        /// </summary>
        [Required(ErrorMessage = "The Street is Required")]
        [DisplayName("街道")]
        public string Street { get; set; }
    }
}
